<?php
declare (strict_types = 1);

namespace app\weapp\controller;

use app\BaseController;
use app\weapp\service\UserService;
use app\weapp\validate\user\UserLoginValidate;
use think\App;
use think\Request;

class User extends BaseController
{
    public function __construct(App $app = null, Request $request = null)
    {
        parent::__construct($app, $request);
    }

    /**
     * 发布资讯
     * @route weapp/user/login
     */
    public function login(UserLoginValidate $v)
    {
        var_dump(1);
        die();
        $postData = $this->request->post();
        $title = htmlspecialchars($postData['title'], ENT_QUOTES);
        $content = htmlspecialchars($postData['content'], ENT_QUOTES);
        $res =  UserService::getInstance()->loginByWeapp($title, $content);
        if ($res['code'] != _MSG_SYSTEM_SUCCESS) {
            $this->_jsonReturnV2($res['code'], $res['data'], $res['msg']);
        }
        $this->_jsonReturnV2(0, $res['data'], $res['msg']);
    }

}
